cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(recipe_20 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)                       # 设置C++语言标准为C++11
set(CMAKE_CXX_EXTENSIONS OFF)                    # 禁用C++语言扩展（如GNU扩展）
set(CMAKE_CXX_STANDARD_REQUIRED ON)              # 要求C++语言标准为C++11

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

find_package(ZeroMQ REQUIRED)

add_executable(hwserver hwserver.cpp)
# 设置hwserver的私有包含目录
target_include_directories(hwserver
  PRIVATE
      ${ZeroMQ_INCLUDE_DIRS}
  )
# 链接hwserver到ZeroMQ库
target_link_libraries(hwserver
  PRIVATE
      ${ZeroMQ_LIBRARIES}
  )


  add_executable(hwclient hwclient.cpp)
# 设置hwclient的私有包含目录
target_include_directories(hwclient
  PRIVATE
      ${ZeroMQ_INCLUDE_DIRS}
  )
# 链接hwclient到ZeroMQ库
target_link_libraries(hwclient
  PRIVATE
      ${ZeroMQ_LIBRARIES}
  )